/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 obelisk_data.h

	$Header: $

	$NoKeywords: $

 ************************************************************************/

#if !defined( OBELISK_DATA_H_INCLUDED )
#define OBELISK_DATA_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include <iosfwd>

#include "obelisk_reward_list.h"
#include "sized_int_types.h"

enum t_obelisk_color;

// -------------------------------------------------------------------
// t_obelisk_data class 
// Holds the read-in-from-the-map info about the obelisks
// -------------------------------------------------------------------
class t_obelisk_data
{
	public:
		t_obelisk_data();

		t_uint16						get_needed_count() const;
		t_obelisk_reward_list const &	get_reward_list() const;
		bool							read( t_obelisk_color color, std::streambuf &stream, int file_version );
		bool							read_from_map( t_obelisk_color color, std::streambuf &stream, int map_version );
		bool							write( std::streambuf &stream ) const;

	private:
		void							clear_needed_count();
		void							set_reward_list_to_defaults( t_obelisk_color color );

		t_uint16						m_needed_count; 
		t_obelisk_reward_list			m_rewards;
};

// -------------------------------------------------------------------
// t_obelisk_data inline members
// -------------------------------------------------------------------

// -------------------------------------------------------------------
// Returns the maximum number of obelisks of this color needed to
// reveal the treasure map. Use the 
// min(get_needed_count(), number_of_obelisks_on_map)
// for the actual needed count
// -------------------------------------------------------------------
inline t_uint16 t_obelisk_data::get_needed_count() const
{
	return m_needed_count;
}

// -------------------------------------------------------------------
// Return the list of rewards for digging at the correct spot
// -------------------------------------------------------------------
inline t_obelisk_reward_list const & t_obelisk_data::get_reward_list() const
{
	return m_rewards;
}


#endif // OBELISK_DATA_H_INCLUDED
